﻿
using System;
using NUnit.Framework;
using RenewalProjects.Libraries.ParamGate.Attributes;
using RenewalProjects.Libraries.ParamGate.Exceptions;

namespace RenewalProjects.Libraries.ParamGate.Tests
{
	[TestFixture]
	public class GeneralParameterAttributeFixture
	{
		[Test]
		public void Validate_Optional_Parameter_No_Parameter_Name()
		{
			OptionalParameterAttribute attr = new OptionalParameterAttribute();
			attr.ValidateAttribute();
			
			attr.ParameterName = String.Empty;
			attr.ValidateAttribute();
		}
		
		[Test]
		[ExpectedException(typeof(ParamGateException))]
		public void Invalid_Optional_Parameter_Name()
		{
			OptionalParameterAttribute attr = new OptionalParameterAttribute();
			attr.ParameterName = "My Parameter";
			attr.ValidateAttribute();
		}
		
		[Test]
		public void Acceptable_Parameter_Name()
		{
			OptionalParameterAttribute attr = new OptionalParameterAttribute();
			attr.ParameterName = "My-Parameter";
			attr.ValidateAttribute();
		}
	}
}
